package com.sxj.corejava.code07_面向对象.封装;

/**
 * @author 石小俊
 * @date 2024年03月16日 9:36
 */
public class User {

    private int id;
    private String username;
    private String password;
    private boolean status;

    // 赋值方法
    public void setId(int id){
        this.id = id;
    }

    public void setUsername(String username){
        this.username = username;
    }

    public void setPassword(String password){
        this.password = password;
    }

    public void setStatus(boolean status){
        this.status = status;
    }

    // 取值方法
    public int getId(){
        return id;
    }

    public String getUsername(){
        return username;
    }

    public String getPassword(){
        return password;
    }

    public boolean getStatus(){
        return status;
    }

    // 对于boolean类型的属性,取值方法建议使用isXxx作为方法名
    public boolean isStatus(){
        return status;
    }
}
